package com.example.administrator.acmapp.Fragment;

import android.content.res.ColorStateList;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import com.example.administrator.acmapp.Adapter.DaynamicListViewAdapter;
import com.example.administrator.acmapp.R;
import com.gordonwong.materialsheetfab.MaterialSheetFab;
import com.suke.widget.SwitchButton;

/**
 * Created by Administrator on 2018/2/1/001.
 */

public class DynamicFragment extends android.support.v4.app.Fragment {

    private View view;
    private ListView mDaynamicListView;
    private DaynamicListViewAdapter daynamicListViewAdapter;

    public DynamicFragment() {

    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.tool_fragment_layout, container, false);
        initView();

        return view;
    }

    private void initView(){
        mDaynamicListView = view.findViewById(R.id.tool_listview);
        daynamicListViewAdapter = new DaynamicListViewAdapter(getActivity());
        mDaynamicListView.setAdapter(daynamicListViewAdapter);
    }

//    private void initView(){
//        SwitchButton switchButton = (SwitchButton)
//                view.findViewById(R.id.switch_button);
//
//        switchButton.setChecked(false);
//        switchButton.isChecked();
//        switchButton.toggle();     //switch state
//        switchButton.toggle(false);//switch without animation
//        switchButton.setShadowEffect(true);//disable shadow effect
//        switchButton.setEnabled(true);//disable button
//        switchButton.setEnableEffect(false);//disable the switch animation
//        switchButton.setOnCheckedChangeListener(new SwitchButton.OnCheckedChangeListener() {
//            @Override
//            public void onCheckedChanged(SwitchButton view, boolean isChecked) {
//                //TODO do your job
//                Toast.makeText(getActivity(), "dsadsad", Toast.LENGTH_SHORT).show();
//            }
//        });
//    }


}
